$(function(){
    var loginName=baseFunction.getUrlParameterValueByKey("loginName");
    var segment=baseFunction.getUrlParameterValueByKey("segment");
    //tab切换
    $(".tab>div").on("click",function(){
        // 换类名
        $(".tab>div").removeClass("current");
        $(this).addClass("current");
        var current=$(this).attr("data-current"); //1全部  2 未认证   3已验证
        if(current==1){
            $(".all").show(0);
            $(".no,.yes").hide(0);
        }else if(current==2){
            $(".no").show(0);
            $(".all,.yes").hide(0);
        }else if(current==3){
            $(".yes").show(0);
            $(".all,.no").hide(0);
        }
    })
    getList1(loginName,segment);
    getList2(loginName,segment);
    getList3(loginName,segment);
})

/**
   * 全部
   */
function  getList1(loginName,segment){
    var data={
      userName: baseFunction.encryption(loginName),
      queryType:"4302",
      arg1: baseFunction.encryption(segment)           
    };
    // var that=this;
    baseFunction.netRequest("param",data,function(res){
      
      if(res.code==200){
          var data=JSON.parse(JSON.parse(res.data).result);
          var html="";
          for(var i=0;i<data.length;i++){
              html+="<div class='li'>"
                    +"<div>"
                    +"<img src='../static/img/members_check_dadt_name.png'>"
                    +"<text>"+data[i].linkMan+"</text>"
                    +"</div>"
                    +"<div>"
                    +"<img src='../static/img/members_check_dadt_phone.png'>"
                    +"<text>"+data[i].mobile+"</text>"
                    +"</div>" 
                    +"<div>"
                    +"<img src='../static/img/members_check_dadt_time.png'>"
                    +"<text>"+data[i].addTime+"</text>"
                    +"</div>"  
                    +"</div>"
          }
          $(".all .total").html("总计"+data.length+"人");
          $(".all .list").html(html);
      }
    })
}
  /**
   * 未认证
   */
function getList2 (loginName,segment) {
    var data = {
      userName: baseFunction.encryption(loginName),
      queryType: "4306",
      arg1: baseFunction.encryption(segment) 
    };
    var that = this;
    baseFunction.netRequest("param", data, function (res) {
        var data=JSON.parse(JSON.parse(res.data).result);
        var html="";
        for(var i=0;i<data.length;i++){
            html+="<div class='li'>"
                +"<div>"
                +"<img src='../static/img/members_check_dadt_name.png'>"
                +"<text>"+data[i].linkMan+"</text>"
                +"</div>"
                +"<div>"
                +"<img src='../static/img/members_check_dadt_phone.png'>"
                +"<text>"+data[i].mobile+"</text>"
                +"</div>" 
                +"<div>"
                +"<img src='../static/img/members_check_dadt_time.png'>"
                +"<text>"+data[i].addTime+"</text>"
                +"</div>"  
                +"</div>"
        }
        $(".no .total").html("总计"+data.length+"人");
        $(".no .list").html(html);
      })

  }
  /**
   * 已认证
   */
function getList3 (loginName,segment) {
    var data = {
      userName: baseFunction.encryption(loginName),
      queryType: "4303",
      arg1: baseFunction.encryption(segment) 
    };
    var that = this;
    baseFunction.netRequest("param", data, function (res) {
        var data=JSON.parse(JSON.parse(res.data).result);
        var html="";
        for(var i=0;i<data.length;i++){
            html+="<div class='li'>"
                +"<div>"
                +"<img src='../static/img/members_check_dadt_name.png'>"
                +"<text>"+data[i].linkMan+"</text>"
                +"</div>"
                +"<div>"
                +"<img src='../static/img/members_check_dadt_phone.png'>"
                +"<text>"+data[i].mobile+"</text>"
                +"</div>" 
                +"<div>"
                +"<img src='../static/img/members_check_dadt_time.png'>"
                +"<text>"+data[i].addTime+"</text>"
                +"</div>"  
                +"</div>"
        }
        $(".yes .total").html("总计"+data.length+"人");
        $(".yes .list").html(html);
    })
}